﻿
#include "stdafx.h"
#include"SaveCount.h"
#include"Controller.h"
#include"Date.h"
#include <iostream>
#include<vector>
#include<ctime>
#include<string>
#include<iomanip>
#include<stdexcept>

using namespace std;

extern tmDate Date(int year, int month, int day);

int AddDays(tmDate &tmDatep, int days)
{
	time_t tmDatept = mktime(&(tmDatep.ttime));
	tmDatept += 86400 * days;
	localtime_s(&(tmDatep.ttime), &tmDatept);
	return 0;
}
/*
int main()
{

	
	string idtofind;
	tmDate nDate=Date(2008, 11, 1);
	//Controller Center(nDate);


	//nDate = Center.fileRead(nDate);
	char cmd;
	do{

		cin >> cmd;
		try
		{ 
		//nDate=Center.getCommand(cmd,nDate);
		}
		catch (runtime_error &e)
		{
			cout << e.what()<<endl;
		}
} while (cmd != 'e');
	/*
	Center.mknewAccount("S3755217",nDate, 0, 0.015);
	Center.mknewAccount("02342342", nDate, 0, 0.015);
	Center.mknewAccount("CC114514", nDate, 0,0.015,-4000);
	Center.accountOp(0, Date(2008, 11, 5), 5000, "salary", "S");
	Center.accountOp(0,Date(2008,11,5), 5000,"salary","S");
	Center.accountOp(2, Date(2008, 11, 10), 4000, "test", "D");
	Center.accountOp(1, Date(2008, 11, 25), 10000, "sell stock 0323", "S");
	Center.accountOp(0, Date(2008, 12, 5), 5000, "salary", "S");
	Center.accountOp(1, Date(2008, 12, 20), 4000, "f", "D");
	Center.accountOp(2, Date(2009, 11, 5), 6000, "test", "D");
	Center.accountOp(2, Date(2010, 1, 5), 3000, "test", "D");
	Center.checkInfo(Date(2008, 11, 5), tmDate(2008, 12, 5),Center.MyAccount);*/
	//cout << "Total: " << Center.getTotal()<<endl;
	/*
	while (1)
	{
		char in;
		cin >> in;

		switch (in)
		{
		case 'A' : cout << "创建一个账户\n"; id = Center.mknewAccount(tmDate, 0, 0.015); cout << id << endl; break;
		case 'F' : cout << "选择等待被操作的账户：\n";  cin >> idtofind; if (SearchAccount(idtofind, Center, Center.Beingtreat)==-1) cout << "没有找到id\n"; else cout << "成功"; break;
		case 'S': cout << "输入存款\n"; cin >> tmDatep; if (SaveMoney(tmDatep, Center) == -1) cout << "没有等待被操作的对象。\n"; else cout << "成功存入。"; break;
		case 'B'://if (Beingtreat != NULL) 
			cout << "用户的数据如下，id:" << Center.Beingtreat->getID() << "余额：" << Center.Beingtreat->getBalance() << "利息：" << Center.Beingtreat->getAcc(); break;
		case 'D':
			cout << "输入增加天数:"; int tmDatep; cin >> tmDatep; tmDate.tmDate_mday + tmDatep; Center.setnowtmDate(tmDate); cout << tmDate.tmDate_mon+" "+tmDate.tmDate_mday; break;
		}

	}*/
/*}*/

